﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using IloveRSS.Models;
using System.Web.Security;

namespace IloveRSS.Controllers
{
    public class AdministrationController : Controller
    {
        //
        // GET: /Administration/
        private DataManager dataManager;

        public AdministrationController(DataManager dm)
        {
            this.dataManager = dm;
        }

        public ActionResult UsersList()
        {
            MembershipUserCollection collection = dataManager.MembershipRepository.GetUsers();
            ViewBag.Users = collection;
            return View();
        }

        public ActionResult DeleteUser(string UserName)
        {
            dataManager.DeleteUser(UserName);
            return RedirectToAction("UsersList");
        }

    }
}
